package com.ht.medicaltreatment.view

import android.content.Context
import com.blankj.utilcode.util.ActivityUtils
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.activity.InventoryOrderListActivity
import com.ht.medicaltreatment.constant.DevicesSDK
import kotlinx.android.synthetic.main.dialog_devices_land_layout.btnOk
import kotlinx.android.synthetic.main.dialog_devices_land_layout.rbPDA
import kotlinx.android.synthetic.main.dialog_devices_land_layout.rbS

class DevicesCheckedLandDailog(context: Context) :BaseDialog(context,600f,450f) {

    override fun getLayoutRes() = R.layout.dialog_devices_land_layout

    init {
        btnOk.setOnClickListener {
            if(rbPDA.isChecked){
                DevicesSDK.devices = DevicesSDK.PDA
            }else{
                DevicesSDK.devices = DevicesSDK.HAND
            }
            dismiss()
            ActivityUtils.startActivity(InventoryOrderListActivity::class.java)
        }

        rbPDA.setOnClickListener {
            rbS.isChecked = false
        }

        rbS.setOnClickListener {
            rbPDA.isChecked = false
        }
    }
}